<?php
namespace app\user\controller;
use app\user\model\Users;
use think\Controller;
use think\Session;
class Login extends Controller{
    function index(){
        return view('login');
    }

    function login(){
        $user=input('user');
        $pwd=input('pwd');
        $users=new Users();
        $users=Users::get($user);
        if (password_verify($pwd,$users['pwd'])){
            Session::set('user',$user);
            return 'success';
        }else{
            return 'error';
        }
    }
}